#ifndef SMARTDELEGATE_H
#define SMARTDELEGATE_H

#include <QItemDelegate>

class SmartDelegate : public QItemDelegate
{
    Q_OBJECT
public:
    explicit SmartDelegate(QObject *parent = 0);

    virtual QWidget * createEditor ( QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const;

    void setAlign(Qt::Alignment align);
    void setPrecision(int precison);
    void setReadOnly();
    void setPasswordHolder();
    void setLogicDelegate();

private:
    void drawDisplay ( QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, const QString & text ) const;

    int precision;
    Qt::Alignment align;

    bool isDefaultPrecision;
    bool isDefaultAlign;
    bool isReadOnly;
    bool isPasswordHolder;
    bool isLogicDelegate;

};

#endif // SMARTDELEGATE_H
